﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using FileModelNS;
using System.Text;
namespace FileModelTest
{
	[TestFixture]
	public class FileContentsTest
	{
		// TODO: Enhance the performance!

		[Test]
		public void testLoading()
		{
			var fileContents = new FileContents( @"..\..\TestResource\notepad.exe");
			Assert.IsTrue( fileContents.FileName.EndsWith( @"..\..\TestResource\notepad.exe"));
			Assert.AreEqual( 67584, fileContents.Length);
		}

		[Test]
		public void testCopyBytes()
		{
			var fileContents = new FileContents(@"..\..\TestResource\notepad.exe");
			var bytes = fileContents.CopyBytes(0x4E, 38);
			string bytesString = Encoding.ASCII.GetString(bytes);
			Assert.AreEqual( "This program cannot be run in DOS mode", bytesString);
		}
	}
}
